/*
# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

# Notice:
# If you wish to use this code for commercial purposes, you must contact the author and obtain explicit authorization.
# The author is not responsible for any direct or indirect losses caused by the use of this code.
# If any of the above terms are violated, the author reserves the right to pursue legal action.
# Disclaimer:
# Please respect intellectual property rights and comply with relevant laws and regulations.

 */
using System;
using System.Collections.Generic;
using UnityEngine;

public class Leveling : MonoBehaviour
{
	public List<List<GameObject>> TutorialHurdleList = new List<List<GameObject>>();

	public List<Sprite> block1_image = new List<Sprite>();

	public List<Sprite> block2_image = new List<Sprite>();

	public List<Sprite> block3_image = new List<Sprite>();

	public List<Sprite> block4_image = new List<Sprite>();

	public List<Sprite> Bomb_image = new List<Sprite>();

	public List<Sprite> Hard_image_first = new List<Sprite>();

	private int gridWidth = 8;

	private List<string> Level0_Trank = new List<string>();

	private List<string> Level1_Trank = new List<string>();

	private List<string> Level2_Trank = new List<string>();

	private List<string> Level3_Trank = new List<string>();

	private List<string> Level4_Trank = new List<string>();

	private List<string> Level5_Trank = new List<string>();

	private List<string> Level6_Trank = new List<string>();

	private List<string> Level7_Trank = new List<string>();

	private List<string> Level8_Trank = new List<string>();

	private List<string> Level9_Trank = new List<string>();

	private List<string> Level10_Trank = new List<string>();

	private List<List<string>> Level_Block_Type = new List<List<string>>();

	private List<int> Level_Hole = new List<int>();

	private List<string> Level0_Bomb = new List<string>();

	private List<string> Level1_Bomb = new List<string>();

	private List<string> Level2_Bomb = new List<string>();

	private List<string> Level3_Bomb = new List<string>();

	private List<string> Level4_Bomb = new List<string>();

	private List<string> Level5_Bomb = new List<string>();

	private List<string> Level6_Bomb = new List<string>();

	private List<string> Level7_Bomb = new List<string>();

	private List<string> Level8_Bomb = new List<string>();

	private List<string> Level9_Bomb = new List<string>();

	private List<string> Level10_Bomb = new List<string>();

	private List<List<string>> Level_Bomb_Type = new List<List<string>>();

	private void Start()
	{
		this.LevelStart();
		//HMSAdsKitManager.Instance.ShowInterstitialAd();
	}

	public void LevelStart()
	{
		this.Level();
		this.HoleLevel();
	}

	private void Level()
	{
		for (int i = 0; i < 100; i++)
		{
			if (i < 58)
			{
				this.Level0_Trank.Add("A");
			}
			else if (i >= 58 && i < 98)
			{
				this.Level0_Trank.Add("B");
			}
			else
			{
				this.Level0_Trank.Add("C");
			}
			this.Level0_Bomb.Add("NOT");
			if (i < 55)
			{
				this.Level1_Trank.Add("A");
			}
			else if (i >= 55 && i < 96)
			{
				this.Level1_Trank.Add("B");
			}
			else
			{
				this.Level1_Trank.Add("C");
			}
			if (i < 3)
			{
				this.Level1_Bomb.Add("BOMB");
			}
			else
			{
				this.Level1_Bomb.Add("NOT");
			}
			if (i < 46)
			{
				this.Level2_Trank.Add("A");
			}
			else if (i >= 46 && i < 89)
			{
				this.Level2_Trank.Add("B");
			}
			else if (i >= 89 && i < 99)
			{
				this.Level2_Trank.Add("C");
			}
			else
			{
				this.Level2_Trank.Add("D");
			}
			if (i < 2)
			{
				this.Level2_Bomb.Add("BOMB");
			}
			else
			{
				this.Level2_Bomb.Add("NOT");
			}
			if (i < 40)
			{
				this.Level3_Trank.Add("A");
			}
			else if (i >= 40 && i < 84)
			{
				this.Level3_Trank.Add("B");
			}
			else if (i >= 84 && i < 98)
			{
				this.Level3_Trank.Add("C");
			}
			else
			{
				this.Level3_Trank.Add("D");
			}
			if (i < 2)
			{
				this.Level3_Bomb.Add("BOMB");
			}
			else
			{
				this.Level3_Bomb.Add("NOT");
			}
			if (i < 38)
			{
				this.Level4_Trank.Add("A");
			}
			else if (i >= 38 && i < 80)
			{
				this.Level4_Trank.Add("B");
			}
			else if (i >= 80 && i < 97)
			{
				this.Level4_Trank.Add("C");
			}
			else
			{
				this.Level4_Trank.Add("D");
			}
			if (i < 3)
			{
				this.Level4_Bomb.Add("BOMB");
			}
			else
			{
				this.Level4_Bomb.Add("NOT");
			}
			if (i < 34)
			{
				this.Level5_Trank.Add("A");
			}
			else if (i >= 34 && i < 73)
			{
				this.Level5_Trank.Add("B");
			}
			else if (i >= 73 && i < 93)
			{
				this.Level5_Trank.Add("C");
			}
			else
			{
				this.Level5_Trank.Add("D");
			}
			if (i < 3)
			{
				this.Level5_Bomb.Add("BOMB");
			}
			else if (i >= 3 && i < 4)
			{
				this.Level6_Bomb.Add("STONE");
			}
			else
			{
				this.Level5_Bomb.Add("NOT");
			}
			if (i < 31)
			{
				this.Level6_Trank.Add("A");
			}
			else if (i >= 31 && i < 67)
			{
				this.Level6_Trank.Add("B");
			}
			else if (i >= 67 && i < 90)
			{
				this.Level6_Trank.Add("C");
			}
			else
			{
				this.Level6_Trank.Add("D");
			}
			if (i < 4)
			{
				this.Level6_Bomb.Add("BOMB");
			}
			else if (i >= 4 && i < 6)
			{
				this.Level6_Bomb.Add("STONE");
			}
			else
			{
				this.Level6_Bomb.Add("NOT");
			}
			if (i < 27)
			{
				this.Level7_Trank.Add("A");
			}
			else if (i >= 27 && i < 59)
			{
				this.Level7_Trank.Add("B");
			}
			else if (i >= 59 && i < 85)
			{
				this.Level7_Trank.Add("C");
			}
			else
			{
				this.Level7_Trank.Add("D");
			}
			if (i < 5)
			{
				this.Level7_Bomb.Add("BOMB");
			}
			else if (i >= 5 && i < 8)
			{
				this.Level7_Bomb.Add("STONE");
			}
			else
			{
				this.Level7_Bomb.Add("NOT");
			}
			if (i < 26)
			{
				this.Level8_Trank.Add("A");
			}
			else if (i >= 26 && i < 54)
			{
				this.Level8_Trank.Add("B");
			}
			else if (i >= 54 && i < 83)
			{
				this.Level8_Trank.Add("C");
			}
			else
			{
				this.Level8_Trank.Add("D");
			}
			if (i < 6)
			{
				this.Level8_Bomb.Add("BOMB");
			}
			else if (i >= 6 && i < 10)
			{
				this.Level8_Bomb.Add("STONE");
			}
			else
			{
				this.Level8_Bomb.Add("NOT");
			}
			if (i < 23)
			{
				this.Level9_Trank.Add("A");
			}
			else if (i >= 23 && i < 50)
			{
				this.Level9_Trank.Add("B");
			}
			else if (i >= 50 && i < 82)
			{
				this.Level9_Trank.Add("C");
			}
			else
			{
				this.Level9_Trank.Add("D");
			}
			if (i < 7)
			{
				this.Level9_Bomb.Add("BOMB");
			}
			else if (i >= 7 && i < 12)
			{
				this.Level9_Bomb.Add("STONE");
			}
			else
			{
				this.Level9_Bomb.Add("NOT");
			}
			if (i < 21)
			{
				this.Level10_Trank.Add("A");
			}
			else if (i >= 21 && i < 46)
			{
				this.Level10_Trank.Add("B");
			}
			else if (i >= 46 && i < 81)
			{
				this.Level10_Trank.Add("C");
			}
			else
			{
				this.Level10_Trank.Add("D");
			}
			if (i < 8)
			{
				this.Level10_Bomb.Add("BOMB");
			}
			else if (i >= 8 && i < 14)
			{
				this.Level10_Bomb.Add("STONE");
			}
			else
			{
				this.Level10_Bomb.Add("NOT");
			}
		}
		this.ShuffleGenericList(this.Level0_Trank);
		this.ShuffleGenericList(this.Level1_Trank);
		this.ShuffleGenericList(this.Level2_Trank);
		this.ShuffleGenericList(this.Level3_Trank);
		this.ShuffleGenericList(this.Level4_Trank);
		this.ShuffleGenericList(this.Level5_Trank);
		this.ShuffleGenericList(this.Level6_Trank);
		this.ShuffleGenericList(this.Level7_Trank);
		this.ShuffleGenericList(this.Level8_Trank);
		this.ShuffleGenericList(this.Level9_Trank);
		this.ShuffleGenericList(this.Level10_Trank);
		this.Level_Block_Type.Add(this.Level0_Trank);
		this.Level_Block_Type.Add(this.Level1_Trank);
		this.Level_Block_Type.Add(this.Level2_Trank);
		this.Level_Block_Type.Add(this.Level3_Trank);
		this.Level_Block_Type.Add(this.Level4_Trank);
		this.Level_Block_Type.Add(this.Level5_Trank);
		this.Level_Block_Type.Add(this.Level6_Trank);
		this.Level_Block_Type.Add(this.Level7_Trank);
		this.Level_Block_Type.Add(this.Level8_Trank);
		this.Level_Block_Type.Add(this.Level9_Trank);
		this.Level_Block_Type.Add(this.Level10_Trank);
		this.ShuffleGenericList(this.Level0_Bomb);
		this.ShuffleGenericList(this.Level1_Bomb);
		this.ShuffleGenericList(this.Level2_Bomb);
		this.ShuffleGenericList(this.Level3_Bomb);
		this.ShuffleGenericList(this.Level4_Bomb);
		this.ShuffleGenericList(this.Level5_Bomb);
		this.ShuffleGenericList(this.Level6_Bomb);
		this.ShuffleGenericList(this.Level7_Bomb);
		this.ShuffleGenericList(this.Level8_Bomb);
		this.ShuffleGenericList(this.Level9_Bomb);
		this.ShuffleGenericList(this.Level10_Bomb);
		this.Level_Bomb_Type.Add(this.Level0_Bomb);
		this.Level_Bomb_Type.Add(this.Level1_Bomb);
		this.Level_Bomb_Type.Add(this.Level2_Bomb);
		this.Level_Bomb_Type.Add(this.Level3_Bomb);
		this.Level_Bomb_Type.Add(this.Level4_Bomb);
		this.Level_Bomb_Type.Add(this.Level5_Bomb);
		this.Level_Bomb_Type.Add(this.Level6_Bomb);
		this.Level_Bomb_Type.Add(this.Level7_Bomb);
		this.Level_Bomb_Type.Add(this.Level8_Bomb);
		this.Level_Bomb_Type.Add(this.Level9_Bomb);
		this.Level_Bomb_Type.Add(this.Level10_Bomb);
	}

	private void HoleLevel()
	{
		for (int i = 0; i < 100; i++)
		{
			if (i < 40)
			{
				this.Level_Hole.Add(1);
			}
			else if (i >= 40 && i < 80)
			{
				this.Level_Hole.Add(2);
			}
			else
			{
				this.Level_Hole.Add(3);
			}
		}
		this.ShuffleGenericList_int(this.Level_Hole);
	}

	public List<GameObject> MakeLine_Left(int level)
	{
		int num = 0;
		int num2 = this.Level_Hole[UnityEngine.Random.Range(0, this.Level_Hole.Count)];
		List<GameObject> list = new List<GameObject>();
		for (int i = 0; i < this.gridWidth; i++)
		{
			if (UnityEngine.Random.Range(0, 2) == 0 && num2 > 0)
			{
				num++;
				num2--;
			}
			else
			{
				int num3 = this.gridWidth - num - num2;
				if (num >= this.gridWidth || num3 <= 0)
				{
					break;
				}
				int num4 = 4;
				if (num3 < 4)
				{
					num4 = num3;
				}
				int num5 = 0;
				bool flag = true;
				bool flag2 = false;
				if (UnityEngine.Random.Range(0, 5) == 2)
				{
					flag2 = false;
				}
				bool flag3 = false;
				while (flag)
				{
					string text = this.Level_Block_Type[level][UnityEngine.Random.Range(0, this.Level_Block_Type[level].Count)];
					int num6 = 0;
					if (text.IndexOf("A") >= 0)
					{
						num6 = 1;
					}
					else if (text.IndexOf("B") >= 0)
					{
						num6 = 2;
					}
					else if (text.IndexOf("C") >= 0)
					{
						num6 = 3;
					}
					else if (text.IndexOf("D") >= 0)
					{
						num6 = 4;
					}
					string text2 = this.Level_Bomb_Type[level][UnityEngine.Random.Range(0, this.Level_Bomb_Type[level].Count)];
					if (num6 <= num4)
					{
						num5 = num6 - 1;
						if (text2.IndexOf("BOMB") >= 0)
						{
							flag2 = true;
						}
						else if (text2.IndexOf("STONE") >= 0)
						{
							flag3 = true;
						}
						break;
					}
				}
				GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Block_Bar" + num5, typeof(GameObject)), new Vector2((float)num, -2.5f), Quaternion.identity);
				gameObject.GetComponent<BrokenEffect>().bomb_block = flag2;
				gameObject.GetComponent<BrokenEffect>().hard_block = flag3;
				if (num5 == 0)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, this.block1_image.Count)];
				}
				else if (num5 == 1)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, this.block2_image.Count)];
				}
				else if (num5 == 2)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, this.block3_image.Count)];
				}
				else if (num5 == 3)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block4_image[UnityEngine.Random.Range(0, this.block4_image.Count)];
				}
				if (flag2)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.Bomb_image[num5];
					gameObject.transform.Find("BombSpark").gameObject.SetActive(true);
				}
				else if (flag3)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.Hard_image_first[num5];
				}
				list.Add(gameObject);
				num += num5 + 1;
			}
		}
		return list;
	}

	public List<GameObject> MakeLine_Right(int level)
	{
		int num = this.gridWidth - 1;
		int num2 = this.Level_Hole[UnityEngine.Random.Range(0, this.Level_Hole.Count)];
		List<GameObject> list = new List<GameObject>();
		for (int i = this.gridWidth - 1; i > 0; i--)
		{
			if (UnityEngine.Random.Range(0, 2) == 0 && num2 > 0)
			{
				num--;
				num2--;
			}
			else
			{
				int num3 = num + 1 - num2;
				if (num < 0 || num3 <= 0)
				{
					break;
				}
				int num4 = 4;
				if (num3 < 4)
				{
					num4 = num3;
				}
				int num5 = 0;
				bool flag = true;
				bool flag2 = false;
				if (UnityEngine.Random.Range(0, 5) == 2)
				{
					flag2 = false;
				}
				bool flag3 = false;
				while (flag)
				{
					string text = this.Level_Block_Type[level][UnityEngine.Random.Range(0, this.Level_Block_Type[level].Count)];
					int num6 = 0;
					if (text.IndexOf("A") >= 0)
					{
						num6 = 1;
					}
					else if (text.IndexOf("B") >= 0)
					{
						num6 = 2;
					}
					else if (text.IndexOf("C") >= 0)
					{
						num6 = 3;
					}
					else if (text.IndexOf("D") >= 0)
					{
						num6 = 4;
					}
					string text2 = this.Level_Bomb_Type[level][UnityEngine.Random.Range(0, this.Level_Bomb_Type[level].Count)];
					if (num6 <= num4)
					{
						num5 = num6 - 1;
						if (text2.IndexOf("BOMB") >= 0)
						{
							flag2 = true;
						}
						else if (text2.IndexOf("STONE") >= 0)
						{
							flag3 = true;
						}
						break;
					}
				}
				GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Block_Bar" + num5, typeof(GameObject)), new Vector2((float)(num - num5), -2.5f), Quaternion.identity);
				gameObject.GetComponent<BrokenEffect>().bomb_block = flag2;
				gameObject.GetComponent<BrokenEffect>().hard_block = flag3;
				if (num5 == 0)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, this.block1_image.Count)];
				}
				else if (num5 == 1)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, this.block2_image.Count)];
				}
				else if (num5 == 2)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, this.block3_image.Count)];
				}
				else if (num5 == 3)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block4_image[UnityEngine.Random.Range(0, this.block4_image.Count)];
				}
				if (flag2)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.Bomb_image[num5];
					gameObject.transform.Find("BombSpark").gameObject.SetActive(true);
				}
				else if (flag3)
				{
					gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.Hard_image_first[num5];
				}
				list.Add(gameObject);
				num -= num5 + 1;
			}
		}
		return list;
	}

	public void ResetTutorial()
	{
		for (int i = 0; i < this.TutorialHurdleList.Count; i++)
		{
			for (int j = 0; j < this.TutorialHurdleList[i].Count; j++)
			{
				if (this.TutorialHurdleList[i][j] != null)
				{
					UnityEngine.Object.Destroy(this.TutorialHurdleList[i][j]);
				}
			}
		}
		this.TutorialHurdleList.Clear();
	}

	public void MakeTutorialBlock()
	{
		this.ResetTutorial();
		List<GameObject> list = new List<GameObject>();
		GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Move_Block_Bar1", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Move_Block_Bar1", typeof(GameObject)), new Vector2(5f, -2.5f), Quaternion.identity);
		GameObject gameObject3 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(7f, -2.5f), Quaternion.identity);
		gameObject.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject2.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject3.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list.Add(gameObject);
		list.Add(gameObject2);
		list.Add(gameObject3);
		this.TutorialHurdleList.Add(list);
		List<GameObject> list2 = new List<GameObject>();
		GameObject gameObject4 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject5 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(5f, -2.5f), Quaternion.identity);
		GameObject gameObject6 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(7f, -2.5f), Quaternion.identity);
		gameObject4.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject5.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject6.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list2.Add(gameObject4);
		list2.Add(gameObject5);
		list2.Add(gameObject6);
		this.TutorialHurdleList.Add(list2);
		List<GameObject> list3 = new List<GameObject>();
		GameObject gameObject7 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject8 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(1f, -2.5f), Quaternion.identity);
		GameObject gameObject9 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		gameObject7.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject8.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject9.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list3.Add(gameObject7);
		list3.Add(gameObject8);
		list3.Add(gameObject9);
		this.TutorialHurdleList.Add(list3);
		List<GameObject> list4 = new List<GameObject>();
		GameObject gameObject10 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject11 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar3", typeof(GameObject)), new Vector2(2f, -2.5f), Quaternion.identity);
		gameObject10.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject11.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block4_image[UnityEngine.Random.Range(0, 4)];
		list4.Add(gameObject10);
		list4.Add(gameObject11);
		this.TutorialHurdleList.Add(list4);
		List<GameObject> list5 = new List<GameObject>();
		GameObject gameObject12 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Move_Block_Bar2", typeof(GameObject)), new Vector2(1f, -2.5f), Quaternion.identity);
		GameObject gameObject13 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		GameObject gameObject14 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(7f, -2.5f), Quaternion.identity);
		gameObject12.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject13.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject14.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list5.Add(gameObject12);
		list5.Add(gameObject13);
		list5.Add(gameObject14);
		this.TutorialHurdleList.Add(list5);
		List<GameObject> list6 = new List<GameObject>();
		GameObject gameObject15 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject16 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(1f, -2.5f), Quaternion.identity);
		GameObject gameObject17 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		gameObject15.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject16.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject17.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		list6.Add(gameObject15);
		list6.Add(gameObject16);
		list6.Add(gameObject17);
		this.TutorialHurdleList.Add(list6);
		List<GameObject> list7 = new List<GameObject>();
		GameObject gameObject18 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject19 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		gameObject18.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject19.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list7.Add(gameObject18);
		list7.Add(gameObject19);
		this.TutorialHurdleList.Add(list7);
		List<GameObject> list8 = new List<GameObject>();
		GameObject gameObject20 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject21 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(2f, -2.5f), Quaternion.identity);
		GameObject gameObject22 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		GameObject gameObject23 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		gameObject20.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject21.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject22.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject23.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		list8.Add(gameObject20);
		list8.Add(gameObject21);
		list8.Add(gameObject22);
		list8.Add(gameObject23);
		this.TutorialHurdleList.Add(list8);
		List<GameObject> list9 = new List<GameObject>();
		GameObject gameObject24 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject25 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(2f, -2.5f), Quaternion.identity);
		GameObject gameObject26 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar3", typeof(GameObject)), new Vector2(4f, -2.5f), Quaternion.identity);
		gameObject24.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject25.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject26.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block4_image[UnityEngine.Random.Range(0, 4)];
		list9.Add(gameObject24);
		list9.Add(gameObject25);
		list9.Add(gameObject26);
		this.TutorialHurdleList.Add(list9);
		List<GameObject> list10 = new List<GameObject>();
		GameObject gameObject27 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject28 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(2f, -2.5f), Quaternion.identity);
		GameObject gameObject29 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		GameObject gameObject30 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Move_Block_Bar0", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		GameObject gameObject31 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(7f, -2.5f), Quaternion.identity);
		gameObject27.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject28.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject29.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject30.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject31.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list10.Add(gameObject27);
		list10.Add(gameObject28);
		list10.Add(gameObject29);
		list10.Add(gameObject30);
		list10.Add(gameObject31);
		this.TutorialHurdleList.Add(list10);
		List<GameObject> list11 = new List<GameObject>();
		GameObject gameObject32 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject33 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		GameObject gameObject34 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(5f, -2.5f), Quaternion.identity);
		GameObject gameObject35 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		gameObject32.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject33.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject34.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject35.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		list11.Add(gameObject32);
		list11.Add(gameObject33);
		list11.Add(gameObject34);
		list11.Add(gameObject35);
		this.TutorialHurdleList.Add(list11);
		List<GameObject> list12 = new List<GameObject>();
		GameObject gameObject36 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(1f, -2.5f), Quaternion.identity);
		GameObject gameObject37 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		GameObject gameObject38 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(5f, -2.5f), Quaternion.identity);
		gameObject36.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject37.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject38.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		list12.Add(gameObject36);
		list12.Add(gameObject37);
		list12.Add(gameObject38);
		this.TutorialHurdleList.Add(list12);
		List<GameObject> list13 = new List<GameObject>();
		GameObject gameObject39 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(0f, -2.5f), Quaternion.identity);
		GameObject gameObject40 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(3f, -2.5f), Quaternion.identity);
		GameObject gameObject41 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(6f, -2.5f), Quaternion.identity);
		GameObject gameObject42 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(7f, -2.5f), Quaternion.identity);
		gameObject39.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject40.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		gameObject41.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject42.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		list13.Add(gameObject39);
		list13.Add(gameObject40);
		list13.Add(gameObject41);
		list13.Add(gameObject42);
		this.TutorialHurdleList.Add(list13);
		List<GameObject> list14 = new List<GameObject>();
		GameObject gameObject43 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar1", typeof(GameObject)), new Vector2(1f, -2.5f), Quaternion.identity);
		GameObject gameObject44 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar0", typeof(GameObject)), new Vector2(4f, -2.5f), Quaternion.identity);
		GameObject gameObject45 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Tutorial_Block_Bar2", typeof(GameObject)), new Vector2(5f, -2.5f), Quaternion.identity);
		gameObject43.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block2_image[UnityEngine.Random.Range(0, 4)];
		gameObject44.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block1_image[UnityEngine.Random.Range(0, 4)];
		gameObject45.transform.Find("BlockImage").GetComponent<SpriteRenderer>().sprite = this.block3_image[UnityEngine.Random.Range(0, 4)];
		list14.Add(gameObject43);
		list14.Add(gameObject44);
		list14.Add(gameObject45);
		this.TutorialHurdleList.Add(list14);
	}

	public List<GameObject> LineReturn(int score)
	{
		List<GameObject> result = new List<GameObject>();
		int num = UnityEngine.Random.Range(0, 2);
		if (score <= 400)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(0);
			}
			else
			{
				result = this.MakeLine_Right(0);
			}
		}
		else if (score > 400 && score <= 1500)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(1);
			}
			else
			{
				result = this.MakeLine_Right(1);
			}
		}
		else if (score > 1500 && score <= 3500)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(2);
			}
			else
			{
				result = this.MakeLine_Right(2);
			}
		}
		else if (score > 3500 && score <= 5000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(3);
			}
			else
			{
				result = this.MakeLine_Right(3);
			}
		}
		else if (score > 5000 && score <= 7000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(4);
			}
			else
			{
				result = this.MakeLine_Right(4);
			}
		}
		else if (score > 7000 && score <= 10000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(5);
			}
			else
			{
				result = this.MakeLine_Right(5);
			}
		}
		else if (score > 10000 && score <= 14000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(6);
			}
			else
			{
				result = this.MakeLine_Right(6);
			}
		}
		else if (score > 14000 && score <= 19000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(7);
			}
			else
			{
				result = this.MakeLine_Right(7);
			}
		}
		else if (score > 19000 && score <= 25000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(8);
			}
			else
			{
				result = this.MakeLine_Right(8);
			}
		}
		else if (score > 25000 && score <= 30000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(9);
			}
			else
			{
				result = this.MakeLine_Right(9);
			}
		}
		else if (score > 30000)
		{
			if (num == 0)
			{
				result = this.MakeLine_Left(10);
			}
			else
			{
				result = this.MakeLine_Right(10);
			}
		}
		return result;
	}

	public List<GameObject> TutorialLineReturn()
	{
		List<GameObject> result = this.TutorialHurdleList[0];
		this.TutorialHurdleList.RemoveAt(0);
		return result;
	}

	public void ShuffleGenericList(List<string> list)
	{
		System.Random random = new System.Random();
		int i = list.Count;
		while (i > 1)
		{
			i--;
			int index = random.Next(i + 1);
			string value = list[index];
			list[index] = list[i];
			list[i] = value;
		}
	}

	public void ShuffleGenericList_int(List<int> list)
	{
		System.Random random = new System.Random();
		int i = list.Count;
		while (i > 1)
		{
			i--;
			int index = random.Next(i + 1);
			int value = list[index];
			list[index] = list[i];
			list[i] = value;
		}
	}
}
